1. Field of the Invention
The present invention relates to a numerical controller having a function of switching the control mode of a spindle motor between a speed control mode and a position control mode.
2. Description of the Related Art
A piston lathe machine for out-of-round (elliptical) workpiece machining repeats a lot of piston-shaped workpiece machining by performing the following two types of machining in sequence.
(1) Performing round turning for an outside shape of a piston or a groove for a piston ring by rotating a workpiece spindle driven by a spindle motor with an S command (hereinafter referred to as speed control)
(2) Executing a movement command for a workpiece spindle and an axis that performs cut-in operation with a machining program by switching the control mode of the workpiece spindle driven by the spindle motor to a position control mode. In this case, out-of-round cutting is performed by synchronizing between the rotation of a rotation axis and the cut-in operation of a cut-in axis using a movement command, which is the function (hereinafter referred to as high-speed cycle machining) of executing a previously prepared command pulse data according to the machining shape.
Elliptical workpiece machining will be described as an example of specific machining procedure. First, a workpiece is machined to a 100-mm radius round shape by the machining in (1) above. Next, the workpiece is machined to an elliptical shape with a major axis of 100 mm and a minor axis 99 mm by the machining in (2) above. In this case, the workpiece machining of an elliptical shape with a minor axis radius of 99 mm is enabled by repeating movement to the 99-mm position, 100-mm position, 99-mm position, and 100-mm position on the basis of an instructed position command pulse with the position of the cut-in axis which moves in synchronization with the rotation axis, in the major axis direction of the rotation axis, assumed to be 100 mm, while executing a position command pulse for the rotation axis for rotational movement of 90 degrees, 180 degrees, 270 degrees, and 360 degrees with the reference position return completion position after switching to position control mode assumed to be oriented in the major direction of the rotation axis (0 degree).
The elliptical shape of an actual piston is a special out-of-round shape with workpiece material and the thermal expansion of each part taken into consideration, so high-speed cycle machining that enables interpolation using arbitrarily specified pulse data for each minute interpolation cycle is performed to improve the machining precision of a required machining shape.
In a numerical controller with a computer, a servo motor can be used for position control or rotational speed control as in a spindle motor. According to the technology disclosed in Japanese Patent Application Laid-Open No. 2001-134321, it is possible to drive an NC axis and a spindle with a servo motor kept in the position control state and it is possible to switch between positioning operation according to a positioning command for the NC axis and rotation operation according to a rotation count command for the spindle, so that it is unnecessary to switch between speed control and position control.
During switching between the machining in (1) and the machining in (2) above, to switch the control mode of the rotating spindle motor from speed control to position control, the spindle motor needs to be decelerated and stopped, and a reference position return command needs to be executed before a position command is executed in position control.
The reference position return command moves the spindle motor to the motor-specific reference position and sets the coordinates of the rotation axis of the numerical controller after the spindle motor stops. Conventionally, for establishing the coordinates of the numerical controller, it is necessary that the movement of the axis concerned be in a stopped state.
The machining in (2) above is performed in position control, but, because the motor performance of an axis that performs cut-in operation and the follow-up performance of the machine have been improved so far to reduce the time for machining an out-of-round workpiece, it is becoming possible to perform machining at a rotational speed close to a speed at which round machining is performed by rotating a spindle in speed control.
In this case, to further reduce the machining cycle time of workpiece machining, it is necessary to reduce the time for deceleration and stop, movement to the reference position, and acceleration during switching from speed control to position control. However, switching from speed control mode to position control mode takes much time, thereby increasing machining cycle time.
In the technology disclosed in Japanese Patent Application Laid-Open No. 2001-134321 above, the NC axis and spindle are driven with the servo motor kept in position control and switching between positioning operation according to the positioning command for the NC axis and rotation operation according to the rotation count command for the spindle is performed, but this patent document does not clearly describes whether or not such switching is possible without stopping the position command and the rotation command, so the problem to be solved is different between the technology disclosed in the above patent document and the numerical controller according to the present invention which has the function of switching the control mode of the spindle motor between speed control mode and position control mode.